package bsts.view.bill;

import java.awt.BorderLayout;
import java.awt.Font;
import java.awt.LayoutManager;
import java.awt.Scrollbar;

import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollBar;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
//Author - Than Htet Aung - A0079950R : 26-March-2011
public class ViewBill extends JDialog{

	public ViewBill(JFrame owner,String billStr) {
		super(owner,true);	
		super.setTitle("View Bill");
		this.setLayout(new BorderLayout());
		JScrollPane scrPane = new JScrollPane();
		//JLabel billStrLbl = new JLabel(billStr);
		JTextArea billStrTa = new JTextArea(billStr);	
		scrPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
		scrPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
		//scrPane.add(billStrLbl, null);
		//scrPane.setViewportView(billStrLbl);
		billStrTa.setFont(new Font("Courier",Font.BOLD,14));
		billStrTa.setEditable(false);
		scrPane.add(billStrTa, null);
		scrPane.setViewportView(billStrTa);		
		this.add("Center", scrPane);	
		this.setSize(500, 700);
		setVisible(true);
		this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
	}

}
